import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types';

const OperationStatusMeta: IPublicTypeComponentMetadata = {
  componentName: 'OperationStatus',
  title: '运营现状2',
  category: '数据展示2',
  group: '出行服务',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  npm: {
    package: 'hzdz-charts',
    version: '0.1.0',
    exportName: 'OperationStatus',
    main: 'src/index.tsx',
    destructuring: true,
    subName: ''
  },
  props: [
    {
      name: 'ref',
      propType: 'object',
    },
    {
      name: 'key',
      propType: 'string',
    },
    {
      name: 'style',
      propType: 'object',
    },
  ],
  configure: {
    props: [
      // 基础属性
      {
        name: 'basic',
        type: 'group',
        display: 'accordion',
        title: {
          label: '基础属性',
        },
        items: [
          {
            name: 'width',
            title: {
              label: '宽度',
              tip: '组件宽度'
            },
            setter: 'NumberSetter',
            defaultValue: 500,
          },
          {
            name: 'height',
            title: {
              label: '高度',
              tip: '组件高度'
            },
            setter: 'NumberSetter',
            defaultValue: 500,
          },
          {
            name: 'noResponsiveScale',
            title: {
              label: '禁用响应式缩放',
              tip: '当父容器有缩放时，禁用子组件的响应式缩放'
            },
            setter: 'BoolSetter',
            defaultValue: true,
          }
        ]
      },
      // StatusBar 组件配置
      {
        name: 'statusBar',
        type: 'group',
        display: 'accordion',
        title: {
          label: '状态栏配置',
        },
        items: [
          {
            name: 'statusBar.chineseText',
            title: {
              label: '中文标题',
              tip: '状态栏中文文字'
            },
            setter: 'StringSetter',
            defaultValue: '运营现状',
          },
          {
            name: 'statusBar.englishText',
            title: {
              label: '英文标题',
              tip: '状态栏英文文字'
            },
            setter: 'StringSetter',
            defaultValue: 'Operation Status',
          },
          {
            name: 'statusBar.theme',
            title: {
              label: '主题样式',
              tip: '状态栏主题样式'
            },
            setter: {
              componentName: 'RadioGroupSetter',
              props: {
                options: [
                  { label: '深色', value: 'dark' },
                  { label: '浅色', value: 'light' }
                ]
              }
            },
            defaultValue: 'dark',
          }
        ]
      },
      // TextNumber 组件配置
      {
        name: 'textNumbers',
        type: 'group',
        display: 'accordion',
        title: {
          label: '统计数据配置',
        },
        items: [
          {
            name: 'textNumbers.progressCount',
            title: {
              label: '累计进展人数',
              tip: '累计进展人数数值'
            },
            setter: 'StringSetter',
            defaultValue: '103561',
          },
          {
            name: 'textNumbers.exitCount',
            title: {
              label: '累计出站人数',
              tip: '累计出站人数数值'
            },
            setter: 'StringSetter',
            defaultValue: '118755',
          },
          {
            name: 'textNumbers.remainingCount',
            title: {
              label: '剩余发送人数',
              tip: '剩余发送人数数值'
            },
            setter: 'StringSetter',
            defaultValue: '73965',
          },
          {
            name: 'textNumbers.textSize',
            title: {
              label: '文字大小',
              tip: '统计数据的文字大小'
            },
            setter: 'NumberSetter',
            defaultValue: 16,
          },
          {
            name: 'textNumbers.numberSize',
            title: {
              label: '数字大小',
              tip: '统计数据的数字大小'
            },
            setter: 'NumberSetter',
            defaultValue: 24,
          },
          {
            name: 'textNumbers.textColor',
            title: {
              label: '文字颜色',
              tip: '统计数据的文字颜色'
            },
            setter: 'ColorSetter',
            defaultValue: '#FFFFFF',
          },
          {
            name: 'textNumbers.numberColor',
            title: {
              label: '数字颜色',
              tip: '统计数据的数字颜色'
            },
            setter: 'ColorSetter',
            defaultValue: '#00FFFF',
          }
        ]
      },
      // TitleHeader 组件配置
      {
        name: 'titleHeader',
        type: 'group',
        display: 'accordion',
        title: {
          label: '标题配置',
        },
        items: [
          {
            name: 'titleHeader.title',
            title: {
              label: '标题文字',
              tip: '标题头部显示的文字'
            },
            setter: 'StringSetter',
            defaultValue: '班次运营管理',
          }
        ]
      },
      // TrafficMonitor 组件配置
      {
        name: 'trafficMonitor',
        type: 'group',
        display: 'accordion',
        title: {
          label: '客流监控配置',
        },
        items: [
          {
            name: 'trafficMonitor.title',
            title: {
              label: '监控标题',
              tip: '客流监控的标题'
            },
            setter: 'StringSetter',
            defaultValue: '客流相机',
          },
          {
            name: 'trafficMonitor.eastExit',
            title: {
              label: '东出站口数值',
              tip: '东出站口的监控数值'
            },
            setter: 'StringSetter',
            defaultValue: '1528526',
          },
          {
            name: 'trafficMonitor.westExit',
            title: {
              label: '西出站口数值',
              tip: '西出站口的监控数值'
            },
            setter: 'StringSetter',
            defaultValue: '1528526',
          },
          {
            name: 'trafficMonitor.southExit',
            title: {
              label: '南出站口数值',
              tip: '南出站口的监控数值'
            },
            setter: 'StringSetter',
            defaultValue: '1528526',
          },
          {
            name: 'trafficMonitor.northExit',
            title: {
              label: '北出站口数值',
              tip: '北出站口的监控数值'
            },
            setter: 'StringSetter',
            defaultValue: '1528526',
          }
        ]
      },
      // 样式属性
      {
        name: 'style',
        type: 'group',
        display: 'accordion',
        title: {
          label: '样式属性',
        },
        items: [
          {
            name: 'style',
            title: {
              label: '自定义样式',
            },
            setter: 'StyleSetter',
          },
          {
            name: 'className',
            title: {
              label: '自定义类名',
            },
            setter: 'StringSetter',
          }
        ]
      }
    ],
    supports: {
      style: true,
      className: true,
    },
    component: {
      isContainer: false,
      isModal: false,
    },
  },
  icon: 'https://img.alicdn.com/imgextra/i4/O1CN01XCiY1B1pxKv7K4j5j_!!6000000005426-2-tps-200-200.png',
};

const snippets: IPublicTypeSnippet[] = [
  {
    title: '运营现状',
    screenshot: '',
    schema: {
      componentName: 'OperationStatus',
      props: {
        width: 500,
        height: 500,
        noResponsiveScale: true,
        statusBar: {
          chineseText: '运营现状',
          englishText: 'Operation Status',
          theme: 'dark'
        },
        textNumbers: {
          progressCount: '103561',
          exitCount: '118755',
          remainingCount: '73965',
          textSize: 16,
          numberSize: 24,
          textColor: '#FFFFFF',
          numberColor: '#00FFFF'
        },
        titleHeader: {
          title: '班次运营管理'
        },
        trafficMonitor: {
          title: '客流相机',
          eastExit: '1528526',
          westExit: '1528526',
          southExit: '1528526',
          northExit: '1528526'
        }
      }
    }
  }
];

export default {
  ...OperationStatusMeta,
  snippets
}; 